package com.channelsoft.cm.application;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.EditText;
import android.widget.ImageButton;
import android.widget.Toast;

public class ClientReCheckActivity extends Activity {
	private EditText edit_code;
	private ImageButton btn_checkcode;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		this.setContentView(R.layout.clientrecheck);
		edit_code = (EditText) this.findViewById(R.id.edit_code);
		btn_checkcode = (ImageButton) this.findViewById(R.id.btn_checkcode);
	}

	public void checkcode(View v) {

		String code = edit_code.getText().toString();

		if ("".equals(code) || code == null) {
			Toast.makeText(this, "请输入验证码!", Toast.LENGTH_LONG).show();
		} else {
			// 发送code去服务端验证
			// 提交验证时需要改变按钮的状态为不可点击,以免重复提交
			// btn_checkcode.setClickable(false);
			if ("43895".equals(code)) {
				ClientReCheckActivity.this.startActivity(new Intent(
						ClientReCheckActivity.this, ReplyActivity.class));
				this.finish();
			} else {
				Toast.makeText(this, "验证码错误", Toast.LENGTH_LONG).show();
//				this.finish();
			}
		}

	}

}
